<?php
/*
 * Created on 01.02.2006
 *
 */
 
class conf_actionHandler
{

    function startElement (& $sender, $attrs, $line)
    {
        $action['type'] = 'action';
        $action['mapping'] = $attrs['mapping'];
        $sender->pushParent($action);
        if (empty($attrs['mapping']))
            die("Attribute mapping missing in tag action in line $line\n"); 
        if (empty($attrs['class']))
            die("Attribute class missing in tag action in line $line\n"); 
        if (empty($attrs['method']))
            if (empty($attrs['methodmapping']))        
                $sender->appendCode('$actions['.$attrs['mapping'].'] = '.$attrs['class'].";\n");
            else
                $sender->appendCode('$actions['.$attrs['mapping'].'] = array(\'class\' => '.$attrs['class']
                    .', \'methodmapping\' => '.(($attrs['methodmapping'] == "'true'")?'true':'false')
                    .', \'bypassViewMapping\' => '.((isset($attrs['bypassViewMapping']) && $attrs['bypassViewMapping'] == "'true'")?'true':'false').");\n");
        else
            $sender->appendCode('$actions['.$attrs['mapping'].'] = array(\'class\' => '.$attrs['class']
                .', \'method\' => '.$attrs['method']
                .', \'bypassViewMapping\' => '.(($attrs['bypassViewMapping'] == "'true'")?'true':'false').");\n");
    }
    
    function endElement (& $sender)
    {
        $sender->popParent();
    }

} 


?>
